///////////////////////////////////////////////////////////////
// Copyright(c) ephiroth
// 
// FileName : formula_2plushh.c
// Creator  : ephiroth
// E-Mail   : ephiroth@gmail.com
// Date     : 2009-05-03
// Comment  : 
//
///////////////////////////////////////////////////////////////
#include "comm.h"

static int func_2plushh (int index , U8 data [])
{
	int m, l , n , d ,ret;
	m = trim_char(data[1],10,100);
	d = trim_char(data[1],1,6);
	if ( index == 0 )
		ret = m;
	else 
	{
		l = func_2plushh(index - 1 ,data) / 10;
		n = func_2plushh(index - 1 ,data) % 10;
		ret = l * n + d +index;
	}
	return ret ;
		
}

static void help_2plushh(U8 * data)
{
	int m,d;
	m = trim_char(data[1],10,100);
	d = trim_char(data[1],1,6);
	printf("[后项数为前项数位上的乘积加上某固定数和index]:%d\t%d\n",m,d);
}

formula formula_2plushh = {
	"two plus hh",
	ft_normal,
	5,
	func_2plushh ,
	help_2plushh,
	
};

